<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Promise API - reject</title>
</head>
<body>
<script type="text/javascript">
    let p1 = Promise.resolve("p1");
    let p2 = Promise.resolve("p2");
    let p3 = Promise.resolve("p3");

    let e1 = Promise.reject("e1");

    //说明: 返回一个新的 promise, 只有所有的 promise 都成功才成功, 只要有一个失败了就直接失败
    // const res = Promise.all([p1, p2, p3]);
    const res = Promise.all([p1, p2, p3, e1]);
    console.log(res);
</script>
</body>
</html>